﻿@using XStudio.XCRF.Data.Entities.BasicInfo
@using XStudio.XCRF.Web.Models.Enums
@model BasicInfo
@(Html.Telerik().Grid<BasicChemo>().Name("BasicChemoViewGrid").Footer(false)
.DataKeys(keys => keys.Add(chemo => chemo.ID))
.Columns(columns =>
{
    columns.ForeignKey(chemo => chemo.Scheme, ChemoSchemeTypeInfo.SelectListItems, "Value", "Text").Title("方案").EditorTemplateName("ChemoScheme");
    columns.BoundDate(chemo => chemo.StartTime).Title("开始时间").Format("{0:MM/dd/yyyy}").EditorTemplateName("Date");
    columns.BoundDate(chemo => chemo.EndTime).Title("结束时间").Format("{0:MM/dd/yyyy}").EditorTemplateName("Date");
    columns.Bound(chemo => chemo.Remark).Title("备注");
    columns.Command(commands =>
    {
        commands.Edit().ButtonType(GridButtonType.Text);
        commands.Delete().ButtonType(GridButtonType.Text);
    }).Title("操作");
})
.ToolBar(commands => commands.Insert().ButtonType(GridButtonType.Text))
.DataBinding(dataBinding =>
{
    dataBinding.Ajax()
        .Select<BasicInfoController>(c => c._BasicChemoList(Model.ID))
        .Insert<BasicInfoController>(c => c._BasicChemoAdd(null, Model.ID))
        .Update<BasicInfoController>(c => c._BasicChemoEdit(null))
        .Delete<BasicInfoController>(c => c._BasicChemoDelete(null));
})
.Editable(edit => edit.Mode(GridEditMode.InLine))
)